package com.hichat.mobile.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.hichat.common.pojo.Friend;
import com.hichat.common.pojo.FriendExample;
import com.hichat.common.util.QueryData;
import com.hichat.common.util.ReturnResult;
import com.hichat.mobile.service.FriendService;
import com.hichat.mobile.util.ConstantProperties;

@RestController
@RequestMapping("/friend")
public class FriendController {

    @Autowired
    private FriendService friendService;

    @Autowired
    private ConstantProperties constantProperties;

    @SuppressWarnings("rawtypes")
    @RequestMapping(value = "/saveFriend",method = RequestMethod.POST)
    public ReturnResult saveFriend(@RequestBody Friend friend){
        ReturnResult result = friendService.insertFriend(friend);
        return result;
    }


    
    @RequestMapping("/getFriendList")
    public ReturnResult getFriendList(@RequestBody QueryData<FriendExample> queryData)throws Exception{
        ReturnResult result = friendService.getFriendList(queryData);
        return result;
    }
}
